﻿<html>
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="Microsoft.Help.SelfBranded" content="true" />
    <meta name="Language" content="en-us" />
    <meta name="Microsoft.Help.Locale" content="en-us" />
    <meta name="Microsoft.Help.TopicLocale" content="en-us" />
    <link rel="shortcut icon" href="../icons/favicon.ico" />
    <link rel="stylesheet" type="text/css" href="../styles/branding.css" />
    <link rel="stylesheet" type="text/css" href="../styles/branding-en-US.css" />
    <script type="text/javascript" src="../scripts/branding.js"></script>
    <title>PerformanceTimer Class</title>
    <meta name="Title" content="PerformanceTimer Class" />
    <meta name="Microsoft.Help.Id" content="T:SosoMS.Common.SystemHelp.PerformanceTimer" />
    <meta name="Microsoft.Help.ContentType" content="Reference" />
    <meta name="System.Keywords" content="SosoMS.Common.SystemHelp.PerformanceTimer class" />
    <meta name="System.Keywords" content="PerformanceTimer class" />
    <meta name="Microsoft.Help.F1" content="SosoMS.Common.SystemHelp.PerformanceTimer" />
    <meta name="Microsoft.Help.F1" content="PerformanceTimer" />
    <meta name="container" content="SosoMS.Common.SystemHelp" />
    <meta name="file" content="dcbffa21-5512-1002-84d6-ff3dd8d87998" />
    <meta name="guid" content="dcbffa21-5512-1002-84d6-ff3dd8d87998" />
    <meta name="Description" content="高性能计时器" />
    <link rel="stylesheet" type="text/css" href="../styles/branding-Help1.css" />
  </head>
  <body onload="SetDefaultLanguage('cs');">
    <input type="hidden" id="userDataCache" class="userDataStyle" />
    <div id="PageHeader" class="pageHeader">嗖嗖常用方法帮助集</div>
    <div class="pageBody">
      <div id="TopicContent" class="topicContent">
        <table class="titleTable">
          <tr>
            <td class="titleColumn">
              <h1>Performance<wbr />Timer Class</h1>
            </td>
          </tr>
        </table>
        <div class="summary">
            高性能计时器
            </div>
        <div class="collapsibleAreaRegion">
          <span class="collapsibleRegionTitle" onclick="SectionExpandCollapse('IDDA')" onkeypress="SectionExpandCollapse_CheckKey('IDDA', event)" tabindex="0">
            <img id="IDDAToggle" class="collapseToggle" src="../icons/SectionExpanded.png" />Inheritance Hierarchy</span>
        </div>
        <div id="IDDASection" class="collapsibleSection">
          <a href="https://learn.microsoft.com/dotnet/api/system.object" target="_blank" rel="noopener noreferrer">System<span id="LSTD5DFC99E_0" data-languageSpecificText="cs=.|vb=.|cpp=::|nu=.|fs=."></span>Object</a>
          <br />  <span class="selflink">SosoMS.Common.SystemHelp<span id="LSTD5DFC99E_1" data-languageSpecificText="cs=.|vb=.|cpp=::|nu=.|fs=."></span>PerformanceTimer</span><br /></div>
        <br />
        <strong>Namespace:</strong> <a href="026ce1e1-007c-0e37-04b4-2e196fe75f90.htm">SosoMS.Common.SystemHelp</a><br /><strong>Assembly:</strong> SosoMS.Common (in SosoMS.Common.dll) Version: 1.0.0<div class="collapsibleAreaRegion"><span class="collapsibleRegionTitle" onclick="SectionExpandCollapse('IDB')" onkeypress="SectionExpandCollapse_CheckKey('IDB', event)" tabindex="0"><img id="IDBToggle" class="collapseToggle" src="../icons/SectionExpanded.png" />Syntax</span></div><div id="IDBSection" class="collapsibleSection"><div id="IDAB" class="codeSnippetContainer"><div class="codeSnippetContainerTabs"><div id="IDAB_tab1" class="codeSnippetContainerTab"><a href="#" onclick="ChangeTab('IDAB','cs','1','4');return false;">C#</a></div><div id="IDAB_tab2" class="codeSnippetContainerTab"><a href="#" onclick="ChangeTab('IDAB','vb','2','4');return false;">VB</a></div><div id="IDAB_tab3" class="codeSnippetContainerTab"><a href="#" onclick="ChangeTab('IDAB','cpp','3','4');return false;">C++</a></div><div id="IDAB_tab4" class="codeSnippetContainerTab"><a href="#" onclick="ChangeTab('IDAB','fs','4','4');return false;">F#</a></div></div><div class="codeSnippetContainerCodeContainer"><div class="codeSnippetToolBar"><div class="codeSnippetToolBarText"><a id="IDAB_copyCode" href="#" class="copyCodeSnippet" onclick="CopyToClipboard('IDAB');return false;" title="Copy">Copy</a></div></div><div id="IDAB_code_Div1" class="codeSnippetContainerCode" style="display: block"><pre xml:space="preserve"><span class="keyword">public</span> <span class="keyword">class</span> <span class="identifier">PerformanceTimer</span></pre></div><div id="IDAB_code_Div2" class="codeSnippetContainerCode" style="display: none"><pre xml:space="preserve"><span class="keyword">Public</span> <span class="keyword">Class</span> <span class="identifier">PerformanceTimer</span></pre></div><div id="IDAB_code_Div3" class="codeSnippetContainerCode" style="display: none"><pre xml:space="preserve"><span class="keyword">public</span> <span class="keyword">ref class</span> <span class="identifier">PerformanceTimer</span></pre></div><div id="IDAB_code_Div4" class="codeSnippetContainerCode" style="display: none"><pre xml:space="preserve"><span class="keyword">type</span> <span class="identifier">PerformanceTimer</span> = <span class="keyword">class</span> <span class="keyword">end</span></pre></div></div></div></div><p>The <span class="selflink">PerformanceTimer</span> type exposes the following members.</p><div class="collapsibleAreaRegion"><span class="collapsibleRegionTitle" onclick="SectionExpandCollapse('IDAEA')" onkeypress="SectionExpandCollapse_CheckKey('IDAEA', event)" tabindex="0"><img id="IDAEAToggle" class="collapseToggle" src="../icons/SectionExpanded.png" />Constructors</span></div><div id="IDAEASection" class="collapsibleSection"><table id="ConstructorList" class="members"><tr><th class="iconColumn"> </th><th>Name</th><th>Description</th></tr><tr><td><img src="../icons/pubMethod.gif" alt="Public method" title="Public method" /></td><td><a href="9f054a14-8a31-33cb-7b3a-4be0bb9d1d1b.htm">PerformanceTimer</a></td><td>
            构造函数
            </td></tr></table><a href="#PageHeader">Top</a></div><div class="collapsibleAreaRegion"><span class="collapsibleRegionTitle" onclick="SectionExpandCollapse('IDMEA')" onkeypress="SectionExpandCollapse_CheckKey('IDMEA', event)" tabindex="0"><img id="IDMEAToggle" class="collapseToggle" src="../icons/SectionExpanded.png" />Properties</span></div><div id="IDMEASection" class="collapsibleSection"><table id="PropertyList" class="members"><tr><th class="iconColumn"> </th><th>Name</th><th>Description</th></tr><tr><td><img src="../icons/pubProperty.gif" alt="Public property" title="Public property" /></td><td><a href="7c613226-b0b7-5889-5a99-90a2ca38c98e.htm">Elapsed</a></td><td>
            计时器经过的时间间隔
            </td></tr><tr><td><img src="../icons/pubProperty.gif" alt="Public property" title="Public property" /></td><td><a href="d09956d9-f43d-d10c-2125-80499fcdac0c.htm">ElapsedMicroseconds</a></td><td>
            计时器经过时间，以微秒为单位
            </td></tr><tr><td><img src="../icons/pubProperty.gif" alt="Public property" title="Public property" /></td><td><a href="d3b53171-2597-ef6d-11ae-4bcecf54ec03.htm">ElapsedMilliseconds</a></td><td>
            计时器经过时间，以毫秒为单位
            </td></tr><tr><td><img src="../icons/pubProperty.gif" alt="Public property" title="Public property" /></td><td><a href="c0c7b9f6-e7a6-e152-d24a-27b63fc36a6c.htm">ElapsedNanoseconds</a></td><td>
            计时器经过时间，以纳秒为单位
            </td></tr><tr><td><img src="../icons/pubProperty.gif" alt="Public property" title="Public property" /></td><td><a href="8e934bd9-e1b8-523b-5612-0cd6366a9847.htm">ElapsedSeconds</a></td><td>
            计时器经过时间，以秒为单位
            </td></tr><tr><td><img src="../icons/pubProperty.gif" alt="Public property" title="Public property" /></td><td><a href="a86157e5-5967-5a8b-d93e-8ad44c527964.htm">IsRunning</a></td><td>
            计时器是否运行
            </td></tr></table><a href="#PageHeader">Top</a></div><div class="collapsibleAreaRegion"><span class="collapsibleRegionTitle" onclick="SectionExpandCollapse('IDBEA')" onkeypress="SectionExpandCollapse_CheckKey('IDBEA', event)" tabindex="0"><img id="IDBEAToggle" class="collapseToggle" src="../icons/SectionExpanded.png" />Methods</span></div><div id="IDBEASection" class="collapsibleSection"><table id="MethodList" class="members"><tr><th class="iconColumn"> </th><th>Name</th><th>Description</th></tr><tr><td><img src="../icons/pubMethod.gif" alt="Public method" title="Public method" /></td><td><a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)" target="_blank" rel="noopener noreferrer">Equals</a></td><td>Determines whether the specified object is equal to the current object.<br />(Inherited from <a href="https://learn.microsoft.com/dotnet/api/system.object" target="_blank" rel="noopener noreferrer">Object</a>)</td></tr><tr><td><img src="../icons/pubMethod.gif" alt="Public method" title="Public method" /><img src="../icons/Static.gif" alt="Static member" title="Static member" /></td><td><a href="d02d4ea4-69e6-0c42-fd58-9e72cf6beec6.htm">Execute</a></td><td>
            传入一个任务，并计算该任务运行的总时间间隔
            </td></tr><tr><td><img src="../icons/protMethod.gif" alt="Protected method" title="Protected method" /></td><td><a href="https://learn.microsoft.com/dotnet/api/system.object.finalize#system-object-finalize" target="_blank" rel="noopener noreferrer">Finalize</a></td><td>Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.<br />(Inherited from <a href="https://learn.microsoft.com/dotnet/api/system.object" target="_blank" rel="noopener noreferrer">Object</a>)</td></tr><tr><td><img src="../icons/pubMethod.gif" alt="Public method" title="Public method" /></td><td><a href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode#system-object-gethashcode" target="_blank" rel="noopener noreferrer">GetHashCode</a></td><td>Serves as the default hash function.<br />(Inherited from <a href="https://learn.microsoft.com/dotnet/api/system.object" target="_blank" rel="noopener noreferrer">Object</a>)</td></tr><tr><td><img src="../icons/pubMethod.gif" alt="Public method" title="Public method" /></td><td><a href="https://learn.microsoft.com/dotnet/api/system.object.gettype#system-object-gettype" target="_blank" rel="noopener noreferrer">GetType</a></td><td>Gets the <a href="https://learn.microsoft.com/dotnet/api/system.type" target="_blank" rel="noopener noreferrer">Type</a> of the current instance.<br />(Inherited from <a href="https://learn.microsoft.com/dotnet/api/system.object" target="_blank" rel="noopener noreferrer">Object</a>)</td></tr><tr><td><img src="../icons/protMethod.gif" alt="Protected method" title="Protected method" /></td><td><a href="https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone#system-object-memberwiseclone" target="_blank" rel="noopener noreferrer">MemberwiseClone</a></td><td>Creates a shallow copy of the current <a href="https://learn.microsoft.com/dotnet/api/system.object" target="_blank" rel="noopener noreferrer">Object</a>.<br />(Inherited from <a href="https://learn.microsoft.com/dotnet/api/system.object" target="_blank" rel="noopener noreferrer">Object</a>)</td></tr><tr><td><img src="../icons/pubMethod.gif" alt="Public method" title="Public method" /></td><td><a href="a9dee475-347c-984c-0cd3-6195b90d969e.htm">Restart</a></td><td>
            计时器重新开始计时
            </td></tr><tr><td><img src="../icons/pubMethod.gif" alt="Public method" title="Public method" /></td><td><a href="4462f64e-b267-0ef8-ef6a-2465c5b269d6.htm">Start</a></td><td>
            计时器开始计时
            </td></tr><tr><td><img src="../icons/pubMethod.gif" alt="Public method" title="Public method" /><img src="../icons/Static.gif" alt="Static member" title="Static member" /></td><td><a href="ff47d62c-91ba-1bcb-fc3c-997a8b2c28f4.htm">StartNew</a></td><td>
            获取一个新的计时器，并启动
            </td></tr><tr><td><img src="../icons/pubMethod.gif" alt="Public method" title="Public method" /></td><td><a href="4c4da100-194c-6e7f-30e2-c46a3310f4c2.htm">Stop</a></td><td>
            计时器停止计时
            </td></tr><tr><td><img src="../icons/pubMethod.gif" alt="Public method" title="Public method" /></td><td><a href="https://learn.microsoft.com/dotnet/api/system.object.tostring#system-object-tostring" target="_blank" rel="noopener noreferrer">ToString</a></td><td>Returns a string that represents the current object.<br />(Inherited from <a href="https://learn.microsoft.com/dotnet/api/system.object" target="_blank" rel="noopener noreferrer">Object</a>)</td></tr></table><a href="#PageHeader">Top</a></div><div class="collapsibleAreaRegion"><span class="collapsibleRegionTitle" onclick="SectionExpandCollapse('IDBC')" onkeypress="SectionExpandCollapse_CheckKey('IDBC', event)" tabindex="0"><img id="IDBCToggle" class="collapseToggle" src="../icons/SectionExpanded.png" />Remarks</span></div><div id="IDBCSection" class="collapsibleSection">
            支持记录经过多少时间，总时间<br />
            可以通过<a href="https://learn.microsoft.com/dotnet/api/system.timespan" target="_blank" rel="noopener noreferrer">TimeSpan</a>查看记录的时间，也可以通过具体的单位查看记录的时间。比如：纳秒、微秒、毫秒、秒。
            </div><div class="collapsibleAreaRegion"><span class="collapsibleRegionTitle" onclick="SectionExpandCollapse('seeAlso')" onkeypress="SectionExpandCollapse_CheckKey('seeAlso', event)" tabindex="0"><img id="seeAlsoToggle" class="collapseToggle" src="../icons/SectionExpanded.png" />See Also</span></div><div id="seeAlsoSection" class="collapsibleSection"><h4>Reference</h4><div><a href="026ce1e1-007c-0e37-04b4-2e196fe75f90.htm">SosoMS.Common.SystemHelp Namespace</a></div></div></div>
    </div>
    <div id="PageFooter" class="pageFooter" />
  </body>
</html>